#ifndef _WX_PROPGRID_PROPDEV_H_
#define _WX_PROPGRID_PROPDEV_H_

class wxArrayEditorDialog;

typedef wxPGProperty wxBasePropertyClass;
typedef wxPGProperty wxBaseParentPropertyClass;

class WXDLLIMPEXP_PG wxPGGlobalVarsClass {
  public:
    wxPGGlobalVarsClass();
    ~wxPGGlobalVarsClass();
    wxString            m_pDefaultImageWildcard;
    wxPGHashMapS2P      m_mapEditorClasses;
    wxArrayPtrVoid      m_arrValidators;
    wxPGHashMapS2P      m_dictPropertyClassInfo;
    wxPGChoices*        m_fontFamilyChoices;
    wxPGCellRenderer*   m_defaultRenderer;
    wxPGVariantDataClassInfo wxVariantClassInfo_long;
    wxPGVariantDataClassInfo wxVariantClassInfo_string;
    wxPGVariantDataClassInfo wxVariantClassInfo_double;
    wxPGVariantDataClassInfo wxVariantClassInfo_bool;
    wxPGVariantDataClassInfo wxVariantClassInfo_arrstring;
    wxPGVariantDataClassInfo wxVariantClassInfo_wxobject;
    wxPGVariantDataClassInfo wxVariantClassInfo_list;
    wxPGVariantDataClassInfo wxVariantClassInfo_wxColour;
    wxPGVariantDataClassInfo wxVariantClassInfo_datetime;
    wxPGChoices         m_boolChoices;
    wxVariant           m_vEmptyString;
    wxVariant           m_vZero;
    wxVariant           m_vMinusOne;
    wxVariant           m_vTrue;
    wxVariant           m_vFalse;
    wxPGCachedString    m_strDefaultValue;
    wxPGCachedString    m_strMin;
    wxPGCachedString    m_strMax;
    wxPGCachedString    m_strUnits;
    wxPGCachedString    m_strInlineHelp;
    bool                m_autoGetTranslation;
    int                 m_offline;
    int                 m_extraStyle;
    #ifdef __WXDEBUG__
    int                 m_warnings;
    #endif

    int HasExtraStyle( int style ) const { return ( m_extraStyle & style ); }

};


#define wxPGIsVariantType(VARIANT, T) \
  ((VARIANT).GetData() && wxPGVariantDataGetClassInfo((VARIANT).GetData()) == wxPGGlobalVars->wxVariantClassInfo_##T)

#define wxPGIsVariantClassInfo(CLASSINFO, T) \
  (CLASSINFO == wxPGGlobalVars->wxVariantClassInfo_##T)

#define wxPGVariant_EmptyString     (wxPGGlobalVars->m_vEmptyString)
#define wxPGVariant_Zero            (wxPGGlobalVars->m_vZero)
#define wxPGVariant_MinusOne        (wxPGGlobalVars->m_vMinusOne)
#define wxPGVariant_True            (wxPGGlobalVars->m_vTrue)
#define wxPGVariant_False           (wxPGGlobalVars->m_vFalse)
#define wxPGVariant_Bool(A)     (A?wxPGVariant_True:wxPGVariant_False)


#define wxPGVariantAssign(A, B) A = B

extern WXDLLIMPEXP_PG wxPGGlobalVarsClass* wxPGGlobalVars;

#include <wx/tokenzr.h>

#define WX_PG_TOKENIZER1_BEGIN(WXSTRING,DELIMITER) \
  wxStringTokenizer tkz(WXSTRING,DELIMITER,wxTOKEN_RET_EMPTY); \
  while ( tkz.HasMoreTokens() ) \
  { \
    wxString token = tkz.GetNextToken(); \
    token.Trim(true); \
    token.Trim(false);

#define WX_PG_TOKENIZER1_END() \
  }

class WXDLLIMPEXP_PG wxPGStringTokenizer {
  public:
    wxPGStringTokenizer( const wxString& str, wxChar delimeter );
    ~wxPGStringTokenizer();
    bool HasMoreTokens();
    wxString GetNextToken();
  protected:
    const wxString*             m_str;
    wxString::const_iterator    m_curPos;
    wxString                    m_readyToken;
    wxUniChar                   m_delimeter;
};

#define WX_PG_TOKENIZER2_BEGIN(WXSTRING,DELIMITER) \
  wxPGStringTokenizer tkz(WXSTRING,DELIMITER); \
  while ( tkz.HasMoreTokens() ) \
  { \
    wxString token = tkz.GetNextToken();

#define WX_PG_TOKENIZER2_END() \
  }

#ifndef __wxPG_SOURCE_FILE__
#include "props.h"
#endif

inline bool wxPG_String_EndsWith( const wxString& str, const wxChar *suffix, wxString *rest = NULL ) {
  return str.EndsWith( suffix, rest );
}

#endif
